<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/9/27
  Time: 17:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri=""%>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="./statics/layui/css/layui.css">
    <style>
        table{
            width: 800px !important;
            margin:0 auto !important;
        }
        .layui-form-item{
            text-align: center;
        }
    </style>
</head>
<body>
、
<%--<c:forEach items="${users}" var="user">--%>
<%--    <p>${user.id}---${user.name}----${user.pass}</p>--%>
<%--</c:forEach>--%>

<p>
    <form action="user?action=list" method="post">
    <div class="layui-form-item">
        <div class="layui-inline">
            <a class="layui-btn layui-bg-blue" href="addUser.jsp">增加用户</a>

            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入姓名" name="name" value="${condition.name}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
            </div>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入密码" name="pass" value="${condition.pass}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
            </div>
            <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
        </div>
    </div>

</form>

</p>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>密码</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
<c:forEach items="${users}" var="user">
    <tr>
        <td>${user.id}</td>
        <td>${user.name}</td>
        <td>${user.pass}</td>
        <td>
<%--?后面参数 多个参数&连接--%>
            <a href="user?action=toupdate&id=${user.id}">修改</a>
            <a href="user?action=delete&id=${user.id}">删除</a>
        </td>
    </tr>
</c:forEach>
    <tr>
        <td colspan="4">
            <a href="user?action=list&page=${page.prePage}">上一页</a>
            <a href="user?action=list&page=${page.nextPage}">下一页</a>
            <a href="user?action=list&page=${page.totalPage}">尾页</a>
            <a href="user?action=list&page=1">首页</a>

        </td>
    </tr>
    </tbody>
<%--一个功能三个页面 list add delete 修改写在查询里面--%>
</table>
</body>
</html>
